import 'package:flutter/material.dart';
import 'package:flutter_chat/common/constant/constants.dart';
import 'package:flutter_chat/common/style/styles.dart';
import 'package:flutter_chat/common/widget/widgets.dart';
import 'package:flutter_chat/pages/application/pages/user/widget/cell_info.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';

import 'logic.dart';

class SettingPage extends CustomGetView<SettingLogic> {
  const SettingPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: customAppBar("设置"),
      body: ListView(
        children: [
          CellInfo(
            onTap: () {
              Get.toNamed(RouterName.about);
            },
            title: "关于我们",
          ),
          const Gap(AppTheme.largeSpace),
          Container(
            padding: const EdgeInsets.symmetric(
              horizontal: AppTheme.largeSpace,
            ),
            height: 40,
            child: ElevatedButton(
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(
                  AppTheme.dangerColor,
                ),
              ),
              onPressed: logic.onLogout,
              child: const Text("退出登录"),
            ),
          ),
        ],
      ),
    );
  }
}
